<?php
require 'vendor/autoload.php';

$app = new think\App();
$app->initialize();

echo "=== 测试插件发现 ===\n\n";

// 获取所有插件
$plugins = \think\admin\Plugin::get();

echo "发现的插件数量: " . count($plugins) . "\n\n";

foreach ($plugins as $code => $plugin) {
    echo "插件代码: {$code}\n";
    echo "插件名称: " . ($plugin['name'] ?? '未知') . "\n";
    echo "插件空间: " . ($plugin['space'] ?? '未知') . "\n";
    echo "---\n";
}

// 尝试直接调用checkin的Service
echo "\n=== 尝试调用checkin Service ===\n\n";

try {
    $service = new \app\checkin\Service($app);
    echo "Service类实例化成功\n";
    echo "appName: " . ($service->appName ?? '未设置') . "\n";
    echo "appCode: " . ($service->appCode ?? '未设置') . "\n";
    
    $menu = \app\checkin\Service::menu();
    echo "\n菜单数量: " . count($menu) . "\n";
    print_r($menu);
    
} catch (\Exception $e) {
    echo "错误: " . $e->getMessage() . "\n";
    echo "堆栈: " . $e->getTraceAsString() . "\n";
}

